package com.crawler.crawler.mapper;

import com.crawler.crawler.domain.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Mapper
public interface BookMapper {

    /**
     * 查询图书
     * @param id
     * @return
     */
    public Book selectBookById(int id);

    /**
     * 查询图书使用地址
     * @param url
     * @return
     */
    public Book selectBookByUrl(String url);

    /**
     * 查询图书列表
     * @param book
     * @return
     */
    public List<Book> selectBookList(Book book);

    /**
     * 插入图书
     * @param book
     * @return
     */
    public int insertBook(Book book);

    /**
     * 更新图书
     * @param book
     * @return
     */
    public int updateBook(Book book);

    /**
     * 删除图书
     * @param book
     * @return
     */
    public int deleteBookById(Book book);

    /**
     * 查询总条数
     * @param book
     * @return
     */
    public int selectBookCount(Book book);
}
